package com.pactera.madp.cp.controller.sidebar;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pactera.madp.common.core.util.R;
import com.pactera.madp.cp.api.vo.ManagerViewCustomerVO;
import com.pactera.madp.cp.service.IContactService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author zkd
 * @date 2022/5/16 17:47
 */
@RestController
@RequestMapping("/managerview-customer-wechat")
@Api(value = "managerviewCustomerWechat", tags = "经理视图-客户-侧边栏")
public class ManagerViewCustomerSidebarController {

    @Autowired
    private IContactService contactService;

    @GetMapping("/contact-page/{wxUserId}")
    @ApiOperation(value = "根据wxUserId分页查询客户列表")
    @ApiImplicitParams({
            @ApiImplicitParam(name="wxUserId",value="成员微信id",dataType = "String"),
            @ApiImplicitParam(name="name",value="客户名/客户号/手机号",dataType = "String")
    })
    public R<IPage<ManagerViewCustomerVO>> getManagerViewCustomerInfoPage(Page page,
                                                                  @PathVariable("wxUserId") String wxUserId,
                                                                  @RequestParam(value = "name",required = false) String name){
        return R.ok(contactService.getManagerViewCustomerInfoPage(page,wxUserId,name)) ;
    }

}
